<template>
    <div class="Lists">
        <div class="box_foot_lists" v-if="Lists1">
                <ul>
                  
                    <div v-for="(item) in Lists1" :key="item.id">
                      <router-link :to="'/details1?id='+item.id" tag="li">
                        <div class="titlebox">
                            <div class="title">{{item.title}}</div>
                            <div class="subtitle">
                                <!-- 存在video数据或者有hot数据的加上con类名 -->
                                <div :class="[{'con':item.video || item.hot}]">{{item.video}}{{item.hot}}</div>
                                <div>{{item.name}} {{item.time}}小时前</div>
                            </div>
                        </div>
                        <div class="imgbox">
                            <img :src="item.img" alt="" class="auto-img">
                        </div>
                        </router-link>
                    </div>
                  
                    
                </ul>
            </div>
    </div>
</template>

<script>
import { getLists} from "../api/lists.js";
    export default {
        data() {
            return {
                Lists1:null,
                Lists2:null
            };
        },
        methods:{
            getListsFun(){
                getLists().then(data=>{

                    this.Lists1=data.data;
                    this.Lists2=data.data2;
                })
            },
        },
        created(){
            this.getListsFun();
        }
    }
</script>

<style lang="scss" >
.Lists{
  padding: 0 13px;
  .box_foot_lists {
    margin-bottom: 10px;
    ul {
      li {
        margin-top: 20px;
        padding-bottom: 15px;
        border-bottom:1px solid #ccc ;
        display: flex;
        justify-content: space-between;
        .titlebox {
          margin-right: 20px;
          flex: 1;
          display: flex;
          flex-direction: column;
          justify-content: space-between;
          .title {
            font-weight: bold;
            margin-bottom: 16px;
            font-size: 15px;
          }
          .subtitle {
            display: flex;
            align-items: center;
            margin-left: -2px;
            div{
              color: #747474;
              font-weight: bold;
              font-size: 12px;
              transform: scale(0.9);
              margin-left: -1px;
              &.con {
                border: 1px solid red;
                border-radius: 5px;
                color: red;
                font-size: 12px;
                font-weight: bold;
                padding: 2px;
              
              }
            }
          }
        }
        .imgbox {
          flex: 0.6;
          border-radius: 6px;
          overflow: hidden;
        }
      }
    }
  }
}
</style>